home *** CD-ROM | disk | FTP | other *** search
Wrap
SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) NNNNAAAAMMMMEEEE SSSSCCCCFFFFFFFFTTTT, DDDDZZZZFFFFFFFFTTTT, CCCCSSSSFFFFFFFFTTTT, ZZZZDDDDFFFFFFFFTTTT - Computes a real-to-complex or complex-to- real Fast Fourier Transform (FFT) SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS Single precision -> Single precision complex Fortran: CCCCAAAALLLLLLLL SSSSCCCCFFFFFFFFTTTT ((((_i_s_i_g_n,,,, _n,,,, _s_c_a_l_e,,,, _x,,,, _y,,,, _t_a_b_l_e,,,, _w_o_r_k,,,, _i_s_y_s)))) C/C++: ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>> iiiinnnntttt ssssccccfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,, ffffllllooooaaaatttt *_x,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_y,,,, ffffllllooooaaaatttt *_t_a_b_l_e,,,, ffffllllooooaaaatttt *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;; C++ STL: ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>> ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>> iiiinnnntttt ssssccccfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,, ffffllllooooaaaatttt *_x,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_y,,,, ffffllllooooaaaatttt*_t_a_b_l_e,,,, ffffllllooooaaaatttt *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;; Double precision -> Double precision complex Fortran: CCCCAAAALLLLLLLL DDDDZZZZFFFFFFFFTTTT ((((_i_s_i_g_n,,,, _n,,,, _s_c_a_l_e,,,, _x,,,, _y,,,, _t_a_b_l_e,,,, _w_o_r_k,,,, _i_s_y_s)))) C/C++: ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>> iiiinnnntttt ddddzzzzfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,, ffffllllooooaaaatttt *_x,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_y,,,, ddddoooouuuubbbblllleeee *_t_a_b_l_e,,,, ddddoooouuuubbbblllleeee *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;; C++ STL: ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>> ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>> iiiinnnntttt ddddzzzzfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,, ddddoooouuuubbbblllleeee *_x,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_y,,,, ddddoooouuuubbbblllleeee *_t_a_b_l_e,,,, ddddoooouuuubbbblllleeee *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;; Single precision complex -> Single precision Fortran: CCCCAAAALLLLLLLL CCCCSSSSFFFFFFFFTTTT ((((_i_s_i_g_n,,,, _n,,,, _s_c_a_l_e,,,, _x,,,, _y,,,, _t_a_b_l_e,,,, _w_o_r_k,,,, _i_s_y_s)))) C/C++: ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>> iiiinnnntttt ccccssssfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_x,,,, ffffllllooooaaaatttt *_y,,,, ffffllllooooaaaatttt *_t_a_b_l_e,,,, ffffllllooooaaaatttt *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;; C++ STL: ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>> ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>> iiiinnnntttt ccccssssfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_x,,,, ffffllllooooaaaatttt *_y,,,, ffffllllooooaaaatttt *_t_a_b_l_e,,,, ffffllllooooaaaatttt *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;; PPPPaaaaggggeeee 1111 SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) Double precision complex -> Double precision Fortran: CCCCAAAALLLLLLLL ZZZZDDDDFFFFFFFFTTTT ((((_i_s_i_g_n,,,, _n,,,, _s_c_a_l_e,,,, _x,,,, _y,,,, _t_a_b_l_e,,,, _w_o_r_k,,,, _i_s_y_s)))) C/C++: ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>> iiiinnnntttt zzzzddddfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_x,,,, ddddoooouuuubbbblllleeee *_y,,,, ddddoooouuuubbbblllleeee *_t_a_b_l_e,,,, ddddoooouuuubbbblllleeee *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;; C++ STL: ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>> ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>> iiiinnnntttt zzzzddddfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_x,,,, ddddoooouuuubbbblllleeee *_y,,,, ddddoooouuuubbbblllleeee *_t_a_b_l_e,,,, ddddoooouuuubbbblllleeee *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;; IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN These routines are part of the SCSL Scientific Library and can be loaded using either the ----llllssssccccssss or the ----llllssssccccssss____mmmmpppp option. The ----llllssssccccssss____mmmmpppp option directs the linker to use the multi-processor version of the library. When linking to SCSL with ----llllssssccccssss or ----llllssssccccssss____mmmmpppp, the default integer size is 4 bytes (32 bits). Another version of SCSL is available in which integers are 8 bytes (64 bits). This version allows the user access to larger memory sizes and helps when porting legacy Cray codes. It can be loaded by using the ----llllssssccccssss____iiii8888 option or the ----llllssssccccssss____iiii8888____mmmmpppp option. A program may use only one of the two versions; 4-byte integer and 8-byte integer library calls cannot be mixed. The C and C++ prototypes shown above are appropriate for the 4-byte integer version of SCSL. When using the 8-byte integer version, the variables of type iiiinnnntttt become lllloooonnnngggg lllloooonnnngggg and the <<<<ssssccccssssllll____fffffffftttt____iiii8888....hhhh>>>> header file should be included. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN SSSSCCCCFFFFFFFFTTTT/DDDDZZZZFFFFFFFFTTTT computes the FFT of the real array _X, and it stores the results in the complex array _Y. CCCCSSSSFFFFFFFFTTTT/ZZZZDDDDFFFFFFFFTTTT computes the corresponding inverse complex-to-real transform. It is customary in FFT applications to use zero-based subscripts; the formulas are simpler that way. For these routines, suppose that the arrays are declared as follows: Fortran: REAL X(0:n-1) COMPLEX Y(0:n/2) C/C++: float x[n]; PPPPaaaaggggeeee 2222 SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) scsl_complex y[n/2+1]; C++ STL: float x[n]; complex<float> y[n/2+1]; Then the output array is the FFT of the input array, using the following formula for the FFT: n-1 Y(k) = scale * Sum [ X(j)*w**(isign*j*k) ] for k = 0, ..., n/2 j=0 where: _w = exp(2*_p_i*_i/_n), _i = + sqrt(-1), _p_i = 3.14159..., _i_s_i_g_n = +1 or -1. Different authors use different conventions for which of the transforms, _i_s_i_g_n = +1 or _i_s_i_g_n = -1, is the forward or inverse transform, and what the _s_c_a_l_e factor should be in either case. You can make these routines compute any of the various possible definitions, however, by choosing the appropriate values for _i_s_i_g_n and _s_c_a_l_e. The relevant fact from FFT theory is this: If you call SSSSCCCCFFFFFFFFTTTT with any particular values of _i_s_i_g_n and _s_c_a_l_e, the mathematical inverse function is computed by calling CCCCSSSSFFFFFFFFTTTT with -_i_s_i_g_n and 1/(_n*_s_c_a_l_e). In particular, if you use _i_s_i_g_n = +1 and _s_c_a_l_e = 1.0 in SSSSCCCCFFFFFFFFTTTT for the forward FFT, you can compute the inverse FFT by using CCCCSSSSFFFFFFFFTTTT with _i_s_i_g_n = -1 and _s_c_a_l_e = 1.0/_n. See the NOTES section of this man page for information about the interpretation of the data types described in the following arguments. These routines have the following arguments: _i_s_i_g_n Integer. (input) Specifies whether to initialize the _t_a_b_l_e array or to do the forward or inverse Fourier transform, as follows: PPPPaaaaggggeeee 3333 SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) If _i_s_i_g_n = 0, the routine initializes the _t_a_b_l_e array and returns. In this case, the only arguments used or checked are _i_s_i_g_n, _n, and _t_a_b_l_e. If _i_s_i_g_n = +1 or -1, the value of _i_s_i_g_n is the sign of the exponent used in the FFT formula. _n Integer. (input) Size of transform. If _n is not positive, the routine returns without calculating the transform. _s_c_a_l_e Scale factor. (input) SSSSCCCCFFFFFFFFTTTT: Single precision. DDDDZZZZFFFFFFFFTTTT: Double precision. CCCCSSSSFFFFFFFFTTTT: Single precision. ZZZZDDDDFFFFFFFFTTTT: Double precision. Each element of the output array is multiplied by _s_c_a_l_e after taking the Fourier transform, as defined in the preceding formula. _x Input array of values to be transformed. (input) SSSSCCCCFFFFFFFFTTTT: Single precision array of dimension _n. DDDDZZZZFFFFFFFFTTTT: Double precision array of dimension _n. CCCCSSSSFFFFFFFFTTTT: Single precision complex array of dimension _n/2 + 1. (input) ZZZZDDDDFFFFFFFFTTTT: Double precision complex array of dimension _n/2 + 1. (input) _y Output array of transformed values. (output) SSSSCCCCFFFFFFFFTTTT: Single precision complex array of dimension _n/2 + 1. (input) DDDDZZZZFFFFFFFFTTTT: Double precision complex array of dimension _n/2 + 1. (input) CCCCSSSSFFFFFFFFTTTT: Single precision array of dimension _n. ZZZZDDDDFFFFFFFFTTTT: Double precision array of dimension _n. The output array, _y, is the FFT of the the input array, _x, computed according to the preceding formula. The output array may be equivalenced to the input array in the calling program. Be careful when dimensioning the arrays, in this case, to allow for the fact that the complex array contains two (real) words more than the real array. _t_a_b_l_e Array of dimension (_n + _N_F_R) (input or output) SSSSCCCCFFFFFFFFTTTT, CCCCSSSSFFFFFFFFTTTT: Single precision array. DDDDZZZZFFFFFFFFTTTT, ZZZZDDDDFFFFFFFFTTTT: Double precision array. Table of factors and roots of unity. See the description of the _i_s_y_s argument for the value of _N_F_R. PPPPaaaaggggeeee 4444 SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) If _i_s_i_g_n = 0, the routine initializes _t_a_b_l_e (table is output only). If _i_s_i_g_n = +1 or -1, the values in _t_a_b_l_e are assumed to be initialized already by a prior call with _i_s_i_g_n = 0 (table is input only). _w_o_r_k Array of dimension _n + 2 SSSSCCCCFFFFFFFFTTTT, CCCCSSSSFFFFFFFFTTTT: Single precision array. DDDDZZZZFFFFFFFFTTTT, ZZZZDDDDFFFFFFFFTTTT: Double precision array. Work array used for intermediate calculations. Its address space must be different from that of the input and output arrays. _i_s_y_s Integer array dimensioned 0000........_i_s_y_s((((0000)))). An array that gives implementation-specific information. All features and functions of the FFT routines specific to any particular implementation are confined to this _i_s_y_s array. In the Origin series implementation, _i_s_y_s((((0000))))====0000 and _i_s_y_s((((0000))))====1111 are supported. In SCSL versions prior to 1.3, only _i_s_y_s((((0000))))====0000 was allowed. For _i_s_y_s((((0000))))====0000, _N_F_R====11115555, and for _i_s_y_s((((0000))))====1111, _N_F_R====222255556666. The _N_F_R words of storage in the _t_a_b_l_e array contain a factorization of the length of the transform. The smaller value of _N_F_R for _i_s_y_s((((0000))))====0000 is historical. It is too small to store all the required factors for the highest performing FFT, so when _i_s_y_s((((0000))))====0000, extra space is allocated when the _t_a_b_l_e array is initialized. To avoid memory leaks, this extra space must be deallocated when the _t_a_b_l_e array is no longer needed. The SSSSCCCCFFFFFFFFTTTTFFFF routine is used to release this memory. Due to the potential for memory leaks, the use of _i_s_y_s((((0000))))====0000 should be avoided. For _i_s_y_s((((0000))))====1111, the value of _N_F_R is large enough so that no extra memory needs to be allocated, and there is no need to call SSSSCCCCFFFFFFFFTTTTFFFF to release memory. If called, it does nothing. NOTE: _i_s_y_s((((0000))))====1111 means that _i_s_y_s is an integer array with two elements. The second element, _i_s_y_s((((1111)))), will not be accessed. NNNNOOOOTTTTEEEESSSS The following data types are described in this documentation: TTTTeeeerrrrmmmm UUUUsssseeeedddd DDDDaaaattttaaaa ttttyyyyppppeeee Fortran: Array dimensioned 0000........_n----1111 xxxx((((0000::::nnnn----1111)))) PPPPaaaaggggeeee 5555 SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) Array of dimensions (_m,_n) xxxx((((mmmm,,,,nnnn)))) Array of dimensions (_m,_n,_p) xxxx((((mmmm,,,,nnnn,,,,pppp)))) IIIInnnntttteeeeggggeeeerrrr IIIINNNNTTTTEEEEGGGGEEEERRRR (IIIINNNNTTTTEEEEGGGGEEEERRRR****8888 for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]]) Single precision RRRREEEEAAAALLLL Double precision DDDDOOOOUUUUBBBBLLLLEEEE PPPPRRRREEEECCCCIIIISSSSIIIIOOOONNNN Single precision complex CCCCOOOOMMMMPPPPLLLLEEEEXXXX Double precision complex DDDDOOOOUUUUBBBBLLLLEEEE CCCCOOOOMMMMPPPPLLLLEEEEXXXX C/C++: Array dimensioned 0000........_n----1111 xxxx[[[[_n]]]] Array of dimensions (_m,_n) xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]] Array of dimensions (_m,_n,_p) xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]] Integer iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]]) Single precision ffffllllooooaaaatttt Double precision ddddoooouuuubbbblllleeee Single precision complex ssssccccssssllll____ccccoooommmmpppplllleeeexxxx Double precision complex ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx C++ STL: Array dimensioned 0000........_n----1111 xxxx[[[[_n]]]] Array of dimensions (_m,_n) xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]] Array of dimensions (_m,_n,_p) xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]] Integer iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]]) Single precision ffffllllooooaaaatttt Double precision ddddoooouuuubbbblllleeee Single precision complex ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> Double precision complex ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> PPPPaaaaggggeeee 6666 SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) CCCCAAAAUUUUTTTTIIIIOOOONNNNSSSS Transform sizes with a prime factor exceeding 22223332222----1111 are not supported for the 8-byte integer version of the library. In addition to the _w_o_r_k array, the FFT routines also dynamically allocate scratch space from the stack. The amount of space allocated can be slightly bigger than the size of the largest processor cache. For single processor runs, the default stack size is large enough that these allocations generally cause no problems. But for parallel runs, you need to ensure that the stack size of slave threads is big enough to hold this scratch space. Failure to reserve sufficient stack space will cause programs to dump core due to stack overflows. The stack size of MP library slave threads is controlled via the MMMMPPPP____SSSSLLLLAAAAVVVVEEEE____SSSSTTTTAAAACCCCKKKKSSSSIIIIZZZZEEEE environment variable or the mmmmpppp____sssseeeetttt____ssssllllaaaavvvveeee____ssssttttaaaacccckkkkssssiiiizzzzeeee(((()))) library routine. See the mmmmpppp(3C), mmmmpppp(3F) and ppppeeee____eeeennnnvvvviiiirrrroooonnnn(5) reference pages for more information on controlling the slave stack size. For pthreads applications, the thread's stack size is specified as one of many creation attributes provided in the pthread_attr_t argument to pppptttthhhhrrrreeeeaaaadddd____ccccrrrreeeeaaaatttteeee(3P). The stacksize attribute should be set explicitly to a non-default value using the pppptttthhhhrrrreeeeaaaadddd____aaaattttttttrrrr____sssseeeettttssssttttaaaacccckkkkssssiiiizzzzeeee(3P) call, described in the pppptttthhhhrrrreeeeaaaadddd____aaaattttttttrrrr____iiiinnnniiiitttt(3P) man page. Care must be exercised if copies of the _t_a_b_l_e array are used: even though a copy exists, the original must persist. As an example, the following code will nnnnooootttt work: #include <scsl_fft.h> float x[1024]; scsl_complex y[513]; float table[1024+256]; float work[1024+2]; int isys[2]; isys[0] = 1; { float table_orig[1024+256]; scfft(0, 1024, 1.0f, x, y, table_orig, work, isys) bcopy(table_orig, table, (1024+256)*sizeof(float)); } scfft(1, 1024, 1.0f, x, y, table, work, isys) In this example, because _t_a_b_l_e__o_r_i_g is a stack variable that does not persist outside of the code block delimited by the braces, the data in the copy, _t_a_b_l_e, are not guaranteed to be valid. However, the following code will work because _t_a_b_l_e__o_r_i_g is persistent: #include <scsl_fft.h> float x[1024]; scsl_complex y[513]; float table_orig[1024+256]; float table[1024+256]; PPPPaaaaggggeeee 7777 SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) float work[1024+2]; int isys[2]; isys[0] = 1; scfft(0, 1024, 1.0f, x, y, table_orig, work, isys) bcopy(table_orig, table, (1024+256)*sizeof(float)); scfft(1, 1024, 1.0f, x, y, table, work, isys) EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS These examples use the table and workspace sizes appropriate to Origin series. Example 1: Initialize the TTTTAAAABBBBLLLLEEEE array in preparation for doing an FFT of size 1024. In this case only the arguments _i_s_i_g_n, _n, and _t_a_b_l_e are used. You can use dummy arguments or zeros for the other arguments in the subroutine call. Fortran: REAL TABLE(1024+256) INTEGER ISYS(0:1) ISYS(0) = 1 CALL SCFFT(0, 1024, 0.0, DUMMY, DUMMY, TABLE, DUMMY, ISYS) C/C++: #include <scsl_fft.h> float table[1024+256]; int isys[2]; isys[0] = 1; scfft(0, 1024, 0.0f, NULL, NULL, table, NULL, isys); C++ STL: #include <complex.h> #include <scsl_fft.h> float table[1024+256]; int isys[2]; isys[0] = 1; scfft(0, 1024, 0.0f, NULL, NULL, table, NULL, isys); Example 2: XXXX is a real array dimensioned (0...1023), and YYYY is a complex array dimensioned (0...:512). Take the FFT of XXXX and store the results in YYYY. Before taking the FFT, initialize the TTTTAAAABBBBLLLLEEEE array, as in example 1. Fortran: REAL X(0:1023) COMPLEX Y(0:512) PPPPaaaaggggeeee 8888 SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) REAL TABLE(1024+256) REAL WORK(1024+2) INTEGER ISYS(0:1) ISYS(0) = 1 CALL SCFFT(0, 1024, 1.0, X, Y, TABLE, WORK, ISYS) CALL SCFFT(1, 1024, 1.0, X, Y, TABLE, WORK, ISYS) C/C++: #include <scsl_fft.h> float x[1024]; scsl_complex y[513]; float table[1024+256]; float work[1024+2]; int isys[2]; isys[0] = 1; scfft(0, 1024, 1.0f, x, y, table, work, isys) scfft(1, 1024, 1.0f, x, y, table, work, isys) C++ STL: #include <complex.h> #include <scsl_fft.h> float x[1024]; complex<float> y[513]; float table[1024+256]; float work[1024+2]; int isys[2]; isys[0] = 1; scfft(0, 1024, 1.0f, x, y, table, work, isys) scfft(1, 1024, 1.0f, x, y, table, work, isys) Example 3: With XXXX and YYYY as in example 2, take the inverse FFT of YYYY and store it back in XXXX. The _s_c_a_l_e factor 1/1024 is used. Assume that the TTTTAAAABBBBLLLLEEEE array is initialized already. Fortran: CALL CSFFT(-1, 1024, 1.0/1024.0, Y, X, TABLE, WORK, ISYS) C/C++ and C++ STL: csfft(-1, 1024, 1.0f/1024.0f, y, x, table, work, isys) Example 4: Perform the same computation as in example 2, but equivalence the input and output arrays to save storage space. Use the 8-byte integer version of SCSL. PPPPaaaaggggeeee 9999 SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) Fortran: REAL X(0:1023) COMPLEX Y(0:512) EQUIVALENCE ( X(1), Y(1) ) REAL TABLE(1024+256) REAL WORK(1024+2) INTEGER*8 ISYS(0:1) ISYS(0) = 1_8 CALL SCFFT(0_8, 1024_8, 1.0, X, Y, TABLE, WORK, ISYS) CALL SCFFT(1_8, 1024_8, 1.0, X, Y, TABLE, WORK, ISYS) C/C++: #include <scsl_fft_i8.h> float *x; scsl_complex y[513]; float table[1024+256]; float work[1024+2]; long long isys[2]; isys[0] = 1LL; x = (float *) &y[0]; scfft(0LL, 1024LL, 1.0f, x, y, table, work, isys) scfft(1LL, 1024LL, 1.0f, x, y, table, work, isys) C++ STL: #include <complex.h> #include <scsl_fft_i8.h> float *x; complex<float> y[513]; float table[1024+256]; float work[1024+2]; long long isys[2]; isys[0] = 1LL; x = (float *) &y[0]; scfft(0LL, 1024LL, 1.0f, x, y, table, work, isys) scfft(1LL, 1024LL, 1.0f, x, y, table, work, isys) Example 5: Perform the same computation as in example 2, but assume that the lower bound of each Fortran array is 1, rather than 0. The subroutine calls are not changed. Fortran: REAL X(1024) COMPLEX Y(513) CALL SCFFT(0, 1024, 1.0, X, Y, TABLE, WORK, ISYS) CALL SCFFT(1, 1024, 1.0, X, Y, TABLE, WORK, ISYS) PPPPaaaaggggeeee 11110000 SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) SSSSCCCCFFFFFFFFTTTT((((3333SSSS)))) SSSSEEEEEEEE AAAALLLLSSSSOOOO IIIINNNNTTTTRRRROOOO____FFFFFFFFTTTT(3S), IIIINNNNTTTTRRRROOOO____SSSSCCCCSSSSLLLL(3S), CCCCCCCCFFFFFFFFTTTT(3S), CCCCCCCCFFFFFFFFTTTTMMMM(3S), SSSSCCCCFFFFFFFFTTTTMMMM(3S) PPPPaaaaggggeeee 11111111